#include <iostream>

#include "myAdd.hpp"

using namespace std;

class Point
{
public:

    friend std::ostream& operator<<(std::ostream &os, const Point & p);
    Point(int x, int y):m_x(x), m_y(y){}
    Point operator+(const Point &p);

private:
    int m_x;
    int m_y;

};



int main()
{
    cout<<myAdd(10, 20)<<endl;
    cout<<myAdd<float>(5.5, 5.4)<<endl;

    Point p1(1, 1);
    Point p2(2, 2);
    Point p3 = myAdd(p1, p2);
    cout<<p3<<endl;

    return 0;
}


Point Point::operator+(const Point &p)
{
    Point result(0, 0);
    result.m_x = this->m_x + p.m_x;
    result.m_y = this->m_x + p.m_y;
    return result;
}

std::ostream& operator<<(std::ostream &os, const Point & p)
{
    os<<"x:"<<p.m_x<<" ,y:"<<p.m_y;
    return os;
}
